/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.manager.search;

import br.com.foxline.model.Enterprise;
import br.com.foxline.service.EnterpriseService;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author roniere
 */
@ManagedBean
@ViewScoped
public class ManagerSearchEnterprise {

    @EJB
    EnterpriseService enterpriseService;

    private Enterprise enterprise;
    
    private List<Enterprise> list;
    
    @PostConstruct
    public void init() {
        enterprise = new Enterprise();
        list = new ArrayList<Enterprise>();
    }

    public List<Enterprise> getList() {
        return list;
    }

    public void setList(List<Enterprise> list) {
        this.list = list;
    }
    
    public void search(){
        list = enterpriseService.findAll();
    
    }

    public Enterprise getEnterprise() {
        return enterprise;
    }

    public void setEnterprise(Enterprise enterprise) {
        this.enterprise = enterprise;
    }
    
    
}
